FROM bellsoft/liberica-openjdk-debian:21 AS builder

WORKDIR app

COPY .. ./

RUN sh ./gradlew && ./gradlew buildFatJar -i -S

FROM bellsoft/liberica-openjre-debian:21 AS runtime

WORKDIR app

ARG env

ENV TZ=Asia/Shanghai ENV=${env}

COPY --from=builder /app/build/libs/microStart-all.jar /app/app.jar

ENTRYPOINT ["java","-jar","app.jar"]

EXPOSE 8080

